import { store } from "@/redux"
import { routerArray } from "@/routers"
import { searchRoute } from "@/utils/util"
import { useLocation } from "react-router-dom"

/** 页面按钮权限hooks */
const useAuthButtons = () => {
    const {pathname} = useLocation()
    const route = searchRoute(pathname, routerArray)
    return {
        BUTTONS: store.getState().auth.authButtons[route.meta!.key!] || {}
    }
    
}

export default useAuthButtons;